﻿using ASmile.Com.Da;
using ASmile.Com.Log;
using ASmile.DBModel;
using ASmile.Tools;
using Microsoft.AspNetCore.Mvc;

namespace ASmile.Web.ApiControllers.SysManage
{
    /// <summary>
    /// 菜单维护
    /// </summary>
    [Route("api/SysManage/[controller]/[action]")]
    [ApiExplorerSettings(GroupName = "SysManage")]
    [LogFilter(false)]
    public class LogController : BaseApiController<LogBLL>
    {
        /// <summary>
        /// 获取日志数据，FormName 区分日志表
        /// </summary>
        [HttpPost]
        public ApiResult<MiniTable> GetLogTable(ArgLogBase arg)
        {
            return BLLObj.GetLogTable(arg);
        }
        /// <summary>
        /// 获取应用日志
        /// </summary>
        [HttpPost]
        public ApiResult<Log_App> GetAppDetail(dynamic arg)
        {
            int id = arg.id;
            return BLLObj.GetAppDetail(id);
        }
        /// <summary>
        /// 获取http请求日志
        /// </summary>
        [HttpPost]
        public ApiResult<Log_Http> GetHttpDetail(dynamic arg)
        {
            int id = arg.id;
            return BLLObj.GetHttpDetail(id);
        }
        /// <summary>
        /// 获取sql日志
        /// </summary>
        [HttpPost]
        public ApiResult<Log_Sql> GetSqlDetail(dynamic arg)
        {
            int id = arg.id;
            return BLLObj.GetSqlDetail(id);
        }
    }
}